package com.tbit.uqbike.webmanager.dao.stat;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tbit.config.datasource.DataSource;
import com.tbit.uqbike.object.pojo.MoneyData;
import com.tbit.uqbike.object.pojo.StatPark;
import com.tbit.uqbike.object.pojo.statistics.DepositOrderDaySta;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@DS(DataSource.STAT)
public interface DepositOrderDayStaDao {
    int insert(DepositOrderDaySta record);

    int insertSelective(DepositOrderDaySta record);

    List<DepositOrderDaySta> queryByMap(Map<String, Object> params);

    /**
     * 月报、根据时间查询日预统计数据
     *
     * @param params 参数个数
     * @return {@link List}<{@link DepositOrderDaySta}>
     */
    List<DepositOrderDaySta> selectDateByMap(Map<String, Object> params);

    void insertBatch(@Param("entities") List<Map<String, Object>> depositOrders);

    void insertByMap(Map<String, Object> maps);

    List<MoneyData> groupByAccountId(Map<String, Object> map);

    void update(DepositOrderDaySta depositOrderDaySta);

    List<StatPark> statByType(Map<String, Object> params);

    DepositOrderDaySta getMortgageFree(Map<String, Object> params);

    /**
     * 查询所有的免押卡日统计记录
     */
    List<DepositOrderDaySta> getDepositCardNumDay(Map<String, Object> params);

    /**
     * 获取区域内免押卡最早一天的数据量
     */
    Date getDepositCardEarliestData(Integer accountId);

    /**
     * 批量删除时间区间呢免押卡预统计
     * @param accountIdList 区域id
     * @param st 开始时间
     * @param et 结束时间
     */
    void deleteById(@Param("List") List<Integer> accountIdList, @Param("st") String st, @Param("et") String et);
}